<?php
use yii\helpers\Url;
use yii\web\View;
// use app\assets\AppAsset;
// AppAsset::register($this);
$this->title = \Yii::t('creative', 'Creative Preview').'--'.\Yii::$app->params['sysMsg']['company'].' Ad Server';
?>
<div class="creative-preview-outer">
  <div class="creative-preview-wrapper">
    <div class="header">
    </div>
    <!-- <div class="row creative-wrapper">
      <div class="col">
        <?php
            $type = $creative['type'];
            if ($type == 5) {
                $div = <<<FINE
    <div class="creative-wrapper">
        <div style="width: $width; height: $height; overflow: hidden;">
            $data
        </div>
    </div>
FINE;
                echo $div;
            }
        ?>
      </div>
    </div> -->
    <?php

        $adtype = $creative['ad_type'];
        $subtype = $creative['subadtype'];
        $img = $creative['file_url'];
        $title = $creative['title'];
        $txt = $creative['txt'];
        $vam_click_url = $creative['landing_page'];
        if ($type == 6 && $adtype == 3 && $subtype == 1) {
            $div = <<<FINE
    <!-- 左图右文 start -->
    <div class="creative-wrapper">
      <div class="vmo-ads image-title-text">
        <a href="$vam_click_url" target="_blank">
          <div class="vmo-ad">
            <div class="vmo-image">
              <img src="$img">
            </div>
            <div class="vmo-title">$title</div>
            <div class="vmo-body">$txt</div>
          </div>
        </a>
      </div>
    </div>
    <!-- 左图右文 end -->
FINE;
            echo $div;
        }
    ?>
    <?php
        if ($type == 6 && $adtype == 3 && $subtype == 2) {
            $div = <<<FINE
    <!-- 上文下图 start -->
    <div class="creative-wrapper">
      <div class="vmo-ads title-image">
        <a href="${vam_click_url}" target="_blank">
          <div class="vmo-ad">
            <div class="vmo-title">
                $title
            </div>
            <div class='vmo-image'>
              <img src="$img">
            </div>
          </div>
        </a>
      </div>
    </div>
    <!-- 上文下图 end -->
FINE;
            echo $div;
        }
    ?>
    <?php
        if ($type == 6 && $adtype == 3 && $subtype == 3) {
            $imgs = explode(',', $creative['file_url']);
            $imgs = array_pad($imgs, 3, '');
            list($img1, $img2, $img3) = $imgs;
                $div = <<<FINE
    <!-- 多图 start -->
    <div class="creative-wrapper">
      <div class="vmo-ads multiple-image">
        <a href="${vam_click_url}" target="_blank">
          <div class="vmo-ad">
            <div class="vmo-title">
                $title
            </div>
            <div class="vmo-images clearfix">
              <div class="vmo-image">
                <img src="$img1">
              </div>
              <div class="vmo-image">
                <img src="$img2">
              </div>
              <div class="vmo-image">
                <img src="$img3">
              </div>
            </div>
          </div>
        </a>
      </div>
    </div>
    <!-- 多图 end -->
FINE;
            echo $div;
        }
    ?>
    <?php
        if ($type == 6 && $adtype == 1) {
            $div = <<<FINE
    <!-- 开屏 start -->
    <div class="creative-wrapper">
      <div class='fullscreen-image'>
        <div class="vmo-image">
          <img src="$img">
        </div>
      </div>
    </div>
    <!-- 开屏 end -->
FINE;
            echo $div;
        }
    ?>
    <div class="footer">
    </div>
  </div>
</div>
